home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / clang / ebksrc.zip / PCPUT2.HPP < prev    next >
C/C++ Source or Header  |  1991-07-30  |  1KB  |  56 lines

  1. /*
  2.  
  3.     pcput2.hpp
  4.     7-30-91
  5.     Write two color text strings
  6.  
  7.     Copyright 1991
  8.     John W. Small
  9.     All rights reserved
  10.     Use freely but acknowledge authorship and copyright.
  11.  
  12.     PSW / Power SoftWare
  13.     P.O. Box 10072
  14.     McLean, Virginia 22102 8072 USA
  15.  
  16.     John Small
  17.     Voice: (703) 759-3838
  18.     CIS: 73757,2233
  19.  
  20. */
  21.  
  22. #ifndef PCPUT2_HPP
  23. #define PCPUT2_HPP
  24.  
  25. #include <conio.h>
  26.  
  27. #define MAX_SCR_LN_BUF   132
  28.  
  29.  
  30. struct ScrLnBuf {
  31.     static int buf[MAX_SCR_LN_BUF];
  32.     int normattr, highattr;
  33.     unsigned pgWidth;
  34.     unsigned startColumn;
  35.     int clreol;
  36.     char lineTermChar;
  37.     unsigned tabSpacing;
  38.     char attrToggleChar;
  39.     int eolColumn, lidx;
  40.     void set(int normattr = WHITE+BLUE*16,
  41.         int highattr = BLUE+LIGHTGRAY*16,
  42.         unsigned pgWidth = 80,
  43.         unsigned startColumn = 1,
  44.         int clreol = 1,
  45.         char lineTermChar = '\n',
  46.         char attrToggleChar = '~',
  47.         unsigned tabSpacing = 8);
  48.     ScrLnBuf()  { set(); }
  49.     int writebuf(const char *line);
  50.     int put(const char * line, int x = 1, int y = 1)
  51.         { return puttext(x,y,x+writebuf(line)-1,
  52.             y,buf); }
  53. };
  54.  
  55. #endif
  56.